<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>{% block title %}博客系统{% endblock %}</title>
    <link rel="shortcut icon" href="{{ url_for('static', filename='favicon.ico') }}">
    <!-- 设置手机属性 -->
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <!-- 设置css -->
    <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
    <link href="{{ url_for('static', filename='materialize/css/materialize.min.css') }}" type="text/css" rel="stylesheet" media="screen,projection"/>
    <!-- 其他页面设置head -->
    {% block head %}
    {% endblock %}
</head>
<body>
<!-- 设置JS-->
<script type="text/javascript" src="{{ url_for('static', filename='materialize/js/jquery-2.1.1.min.js') }}"></script>
<script type="text/javascript" src="{{ url_for('static',filename='materialize/js/materialize.min.js') }}"></script>
{% block body %}
{% endblock %}
<nav>
    <div class="nav-wrapper teal accent-3">
        <div class="container">
            <a class="brand-logo">
            <img src="{{ url_for('static',filename='dog.jpg') }}" alt="" class="circle responsive-img">
                CJ's Blog</a>
            <ul id="nav-mobile" class="right hide-on-med-and-down">
                {% if current_user.id %}
                <ul id="dropdown1" class="dropdown-content">
                    <li><a href="#!">我的资料</a></li>
                    <li><a href="{{url_for('userpage',userpage_id=current_user.id)}}">我的主页</a></li>
                    <li class="divider"></li>
                    <li><a href="{{url_for('logout')}}">注销</a></li>
                </ul>
                <li><a href="{{ url_for('write',user_id=current_user.id )}}"><i class="material-icons">mode_edit</i></a></i></li>
                <li><a class="dropdown-button" href="#!" data-activates="dropdown1">{{ current_user.username }}<i class="material-icons right">arrow_drop_down</i></a></li>
                {% else %}
                <li><a href="{{ url_for('login') }}">登录</a></li>
                <li><a href="{{ url_for('signup') }}">注册</a></li>
                {% endif %}
            </ul>
        </div>
    </div>
</nav>
{% block content %}
{% endblock %}
{% block js %}
{% endblock %}
</body>
</html>